<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商户注册</title>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<link href="../style/common.css"  rel="stylesheet" type="text/css" />

<script type="text/javascript">

function submit_register()
{
	var isnull = 0;
	 $('input[name="user_role"]:checked').each(function(){
	  	 isnull++;
	  });
	  if(isnull == 0)
	  {
		   alert('请选择身份!');
		   return false;
	  }
	
  var username = $("#username").val().trim();
  if( username  ==  ""){
	  $("#username").focus();
	  alert("请填写申请人姓名.");
	  return false;
  }

  var mobile = $("#mobile").val().trim();
  if(!checkMobilePhone(mobile)){
	    alert("手机号码填写不正确。");
	  	$("#mobile").val("");
	    $("#mobile").focus();
		return false;
  }

  var pwd = $("#pwd").val().trim();
  var pwd_repeat = $("#pwd_repeat").val().trim();

  if( pwd  ==  ""){
	  $("#pwd").focus();
	  alert("请填写密码。");
	  return false;
  }
  
  if( pwd_repeat  ==  ""){
	  $("#pwd_repeat").focus();
	  alert("请填写确认密码。");
	  return false;
  }

  if( pwd != pwd_repeat){
	  $("#pwd").val("");
	  $("#pwd_repeat").val("");
	  $("#pwd").focus();
	  alert("两次输入的密码不一致。");
	  return false;
  }
 
  var agreement = $("#agreement").attr("checked");
  if( !agreement ){
	  alert("您还未同意本网站商户协议。");	
	  return false;
  }

  $("#registerForm").submit();
  
}
</script>
<style type="text/css">
.style15 {color: #FF6600}
.bt14A {font-family: "宋体";font-size: 14px;line-height: 25px;color: #666666;padding: 5px 5px 5px 5px;}
.nw12a {font-family: "宋体";font-size: 12px;line-height: 22px;color: #000000;padding: 5px 10px 5px 10px;}

#main{margin: 0 auto;width: 960px;height: 400px;background: url("${ctx}/images/login/background.jpg");overflow: auto;;border: 1px solid #ccc;margin-top: 5px;}
#content{margin: 10px 0px 0px 30px;}
.errorMessage{list-style:none;margin: 0;padding: 0;font-size: 13px;}
.input{border: 1px solid #cccccc;-moz-border-radius: 3px;-webkit-border-radius: 3px;height: 18px;line-height: 17px;padding: 8px 5px 7px;width: 200px;font-size: 14px;}
</style>
</head>

<body>
<s:actionerror/>
<s:actionmessage/>

<!-- 页面头部  -->
<jsp:include page="/commons/head.jsp"></jsp:include>

<div id="main">
	 <div style="margin: 30px 0px 0px 75px;">
		<span><img src="${ctx}/images/login/register.jpg"/></span>
  	 </div>
	<div id="content">
		<form action="${ctx }/member/memberAction!register.do" method="post" id="registerForm" name="registerForm" style="margin: 0px;padding: 0px">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
			      <tr>
				        <td class="bt14A" align="right">选择身份：<span class="style15">*</span></td>
				        <td class="bt14A" style="color: #FF6600 ">
				        	<%--
				        			<input type="radio" name="user_role" value="9">
				        				作品提供商
				        			<input type="radio" name="user_role" value="10">
				        		拍卖行
				        		<input type="radio" name="user_role" value="11">
				        		艺术家 --%>
				        	   <input type="radio" name="user_role" value="20">
				        			作品提供商
				        		<input type="radio" name="user_role" value="21">
				        			渠道商
				        </td>
			        </tr>
			        <tr>
				        	<td class="bt14A" align="right">申请人：<span class="style15">*</span></td>
				        	<td class="bt14A">
				        		<div style="float: left;">
				               	 	<input type="text" name="userInfo.username" id="username" maxlength="50" class="input">
				                </div>
				                <div style="float: left;padding: 5px 0px 0px 5px;">
				               		 <span style="font-size: 12px;">请填写真实姓名</span>
				                </div>
				          	</td>
				          	<td><s:fielderror fieldName="username" theme="simple" cssStyle="color:red"/></td>
			          </tr>
			         <tr>
				         <td class="bt14A" align="right">手机号码：<span class="style15">*</span></td>
				         <td class="bt14A"><input type="text" name="userInfo.mobile" id="mobile" maxlength="20" class="input"></td>
			           </tr>
			            <tr>
				            <td class="bt14A" align="right">创建密码：<span class="style15">*</span></td>
				            <td class="bt14A"><input type="password" name="userInfo.password" id="pwd" maxlength="50" class="input"></td>
			            </tr>
			            <tr>
				            <td class="bt14A" align="right">确认密码：<span class="style15">*</span></td>
				            <td class="bt14A"><input type="password" name="pwd_repeat" id="pwd_repeat" maxlength="50" class="input"></td>
			            </tr>
			          <tr><td></td>
				           <td class="bt14A">
				                  <input type="checkbox" name="agreement" id="agreement" value="yes" checked="checked">
					         			<a href="${ctx }/about/policy.jsp" target="_blank"><span style="font-size: 12px;">同意《可观艺术网商户协议》</span></a>
					        </td>
			         </tr>
			      <tr>
			      	<td width="120"></td>
			        <td>
			        	<div style="float: left;">
			        		<input type="button" value="注  册" onclick="javascript:submit_register();" class="btn_login"/> 
			        	</div>
			        	<div style="float: left;padding-left: 50px;line-height: 34px;height: 34px;">
			        		<a href="${ctx }/login.jsp" style="color: blue">登录</a>
			        	</div>
			        </td>
			      </tr>
			</table>
	   </form>
	</div>
</div>

<!-- 页面底部 -->
<jsp:include page="/commons/foot.jsp"/>
</body>
</html>